package ch.elca.lol.puissance4.player;

import ch.elca.lol.puissance4.game.Token;

/**
 * Abstract implementation of Player providing some helper methods and default implementations.
 * Most AI implementors will probably prefer to extend this than to implement Player themselves.
 */
public abstract class PlayerHelper implements Player {
	private Token token;
	protected int lastMove = -1;
	protected int turn = 0;
	
	@Override
	public void setToken(Token t) {
		this.token = t;
	}
	
	protected final Token getToken() {
		return token;
	}
	
	@Override
	public void played(int col) {
		turn++;
		lastMove = col;
	}
	
	@Override
	public String toString() {
		return this.getClass().getSimpleName();
	}
}
